-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Support for CBAT uavcan message parsing #24973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e584afa
to
d6cf5a4
Compare
bec51bf
to
31862fd
Compare
3c3889c
to
32d5e4c
Compare
32d5e4c
to
0398d13
Compare
0398d13
to
046eb10
Compare
Now that #24960 was merged I rebased these two commits and they are ready for review. |
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 2200 byte (0.1 %)]
px4_fmu-v6x [Total VM Diff: 2120 byte (0.11 %)]
Updated: 2025-06-25T14:23:26 |
- timestamp was 0 if uavcan::BatteryInfo was received before uavcan::BatteryInfoAux - scale was not set as unknown (-1) even though it is since it's never updated - time_remaining was not initialized correctly and could sometimes be 0 unexpectedly which causes the drone to failsafe because there's reportedly no flight time left
emitted by e.g. uavcan Tattu batteries.
Thanks to @sfuhrer 's review I was able to fix multiple mistakes in the original version:
Here's the exact diff from https://github.com/PX4/PX4-Autopilot/compare/a5d609616d76c2fbc43aa6af6737ce7e434259ad..2b50feae877a9c227053be410fe5c8688cc5c0eb#diff-d80076ce90512824ec6432761dee8db1468f527072bc8eb0ab386ac42978ffd8R227 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool that you could solve so many old issues in one go!
Solved Problem
Related to #24960 when trying to track the serial number of Tattu UAVCAN batteries, we found that they only provide this information in a separate
cuav::equipment::power::CBAT
message.Closes #24088
Solution
Add parsing for said message while stopping to pars the other UAVCAN battery information messages for any instance that provides CBAT because it contains a superset of the battery fields.
Changelog Entry
Test coverage
This kind of battery is the main way I'm testing the latest version of #24960 (comment) so please see there for results and screenshot.